package dao;

import util.DBHelper;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

public class ReturnReasonDao {
    public long queryTotal(){
        String sql = " select o.* from returncause o INNER JOIN orderdetail r ON o.detailid=r.detailid where 1=1 ";

        List<String> params = new ArrayList<>();

        return DBHelper.count(sql,params.toArray());
    }

    // 分页查询
    public List<Map<String,Object>> selectLimit( int begin, int end){
        String sql = " select o.* from returncause o INNER JOIN orderdetail r ON o.detailid=r.detailid where 1=1 ";
        List<String> params = new ArrayList<>();

        sql +=" limit "+begin + "," +end;

        return DBHelper.selectListMap(sql,params.toArray());
    }
}
